package cn.hiapi.shopkeeper.entity.user;

import cn.hiapi.basic.entity.BasicEntity;
import cn.hiapi.basic.serializer.LongToStringSerializer;
import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.util.TimeZone;

/**
 * @author AdinZ
 * @date 2022/12/31 21:49
 */
@Entity
@Table(name = "hiapi_shopkeeper_history_record")
@ApiModel(description = "历史足迹")
@Getter
@Setter
public class HistoryRecord extends BasicEntity {
    @Id
    @GeneratedValue(generator = "snowflake")
    @GenericGenerator(name = "snowflake", strategy = "cn.hiapi.basic.id.SnowflakeId")
    @JSONField(serializeUsing = LongToStringSerializer.class)
    private Long id;


    @ApiModelProperty("用户")
    private long uid;

    @ApiModelProperty("活动id")
    private long aid;

    @ApiModelProperty("店铺id")
    private long shopId;
    @Column(name = "_day")
    private String day = DateFormatUtils.format(System.currentTimeMillis(), "yyyy-MM-dd", TimeZone.getTimeZone("Asia/Shanghai"));

    @ApiModelProperty("浏览时间")
    private long created = System.currentTimeMillis();


}
